package com.lcx.movie.common;

import lombok.Data;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * 统一接口返回对象
 */
@Data
@Component
public class R {
    private int code=0;
    private String message="成功";
    private Map<String,Object>data=new HashMap<>();
    private String url;//新增的图片路径

    public R addDate(String key,Object value){
        this.data.put(key, value);
        return this;
    }

    public int getCode() {
        return code;
    }

    public R setCode(int code) {
        this.code = code;
        return this;
    }

    public String getMessage() {
        return message;
    }

    public R setMessage(String message) {
        this.message = message;
        return this;
    }

    public Map<String, Object> getData() {
        return data;
    }

    public void setData(Map<String, Object> data) {
        this.data = data;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }
}
